SRC = $(wildcard *.c)
OBJ = $(SRC:%.c=%.o)
LIB = ../lib/libbmp.so ../lib/libjpg.so ../lib/liblcd.so

CC += -shared -fPIC


all: $(LIB)
$(LIB):../lib/lib%.so:%.o
	$(CC) -o $@ $^

CFLAGS += -I ../include
CFLAGS += -I /home/xiaohuang/download/jpeg-9d/build/include

$(OBJ):%.o:%.c
	$(CC) $^ -o $@ -c -fPIC $(LDFLAGS) $(CFLAGS)

clean:
	$(RM) $(OBJ)

distclean:clean
	$(RM) $(LIB)